
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Probability.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(TestProbability)
{
	TEST("should be able to get the probability of 2 events occurred in same time: p=0.5*0.6=0.3")
	{
	    Probability probability(0.5, 0.6);
	    ASSERT_EQ(0.3f, probability.twoEventsOccurInSameTime());
	}

	TEST("should be able to get the probability of any event occurred: p=1-(1-0.5)*(1-0.6)=0.8")
	{
	    Probability probability(0.5, 0.6);
	    ASSERT_EQ(0.8f, probability.anyEventOccurs());
	}
	
	TEST("should be able to get the probability of event A which won't happen: p=1-0.5=0.5")
	{
            Probability probability(0.5, 0.6);
	    ASSERT_EQ(0.5f, probability.eventAWontOccur());
	}
};
